package com.mhjy.input.config;

import com.mhjy.input.repository.model.BaseResultModel;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

@ControllerAdvice
public class GlobalExceptionHandler {

    @ExceptionHandler(value = Exception.class)
    @ResponseBody
    public BaseResultModel bizExceptionHandler(Exception e) {
        return new BaseResultModel(99, e.getMessage());
    }
}
